package com.qingzhuge.sys.controller;

import com.qingzhuge.common.Constants;
import com.qingzhuge.common.annotation.ASysLog;
import com.qingzhuge.common.enums.EResourceType;
import com.qingzhuge.controller.BasePkLongController;
import com.qingzhuge.core.annotation.AResource;
import com.qingzhuge.dto.response.ResponseBodyDto;
import com.qingzhuge.sys.dto.request.SysDictRequestDto;
import com.qingzhuge.sys.dto.response.SysDictResponseDto;
import com.qingzhuge.sys.entity.SysDict;
import com.qingzhuge.sys.service.ISysDictService;
import com.qingzhuge.utils.PageUtil;
import io.swagger.annotations.Api;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author : zero.xiao
 * @description : 数据字典
 * @date :2018/6/8 0008 下午 14:49
 * @modified :
 */
@ASysLog(value = "数据字典")
@AResource(name = "数据字典", type = EResourceType.menu, catalog = "系统管理")
@Api(tags = "S数据字典")
@RestController
@RequestMapping("api/sys/auth/dict")
public class SysDictController extends BasePkLongController<SysDict, ISysDictService, SysDictRequestDto, SysDictResponseDto> {

    @Override
    @GetMapping(Constants.Controller.PATH_LIST)
    public ResponseEntity<ResponseBodyDto<List<SysDictResponseDto>>> queryList(@RequestBody(required = false) SysDictRequestDto param) {
        return super.queryList(param);
    }

    @Override
    public ResponseEntity<ResponseBodyDto<PageUtil<SysDictResponseDto>>> queryPage(@RequestBody(required = false) SysDictRequestDto param) {
        return super.queryPage(param);
    }

    @Override
    public ResponseEntity<ResponseBodyDto<SysDictResponseDto>> get(@PathVariable Long id) {
        return super.get(id);
    }

    @Override
    public ResponseEntity<ResponseBodyDto<SysDictResponseDto>> save(@RequestBody SysDictRequestDto dict) {
        return super.update(dict);
    }

    @Override
    public ResponseEntity<ResponseBodyDto<SysDictResponseDto>> update(@RequestBody SysDictRequestDto dict) {
        return super.update(dict);
    }

    @Override
    public ResponseEntity<ResponseBodyDto<Object>> delete(@PathVariable Long id) {
        return super.delete(id);
    }
}
